import Storage from "@/untils/storage";
const state = {
  //token
  token: Storage.get("token"),
  myRoutes: false
};


const actions = {
  setToken({ commit }, data) {
    commit("setToken", data);
  },
  setRoutes({ commit }, data) {
    commit("setRoutes", data);
  },
};

const mutations = {
  setToken(state, data) {
    Storage.set("token", data);
    state.token = Storage.get("token");
  },
  setRoutes(state, data) {
    Storage.set("myRoutes", data);
    state.myRoutes = Storage.get("myRoutes");
  }
};

export default {
  state,
  actions,
  mutations
};
